From 60fa0da96d43baec777f598467044fbd816c4c47 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Tue, 11 Aug 2009 12:58:48 +0200 Subject: [PATCH] Implement fallback for old draw_drawable vfunc GdkDrawable->draw_drawback was replaced with a new vfunc draw_drawback_with_src that is now called from gdk_draw_drawable. However, some code seems to call the vfunc directly (see bug #591288), so make it chain to the new call. Note that such direct vfunc calls are a bad idea and won't work for all cases. --- gdk/gdkdraw.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/gdk/gdkdraw.c b/gdk/gdkdraw.c index 714753083b..8ab946479c 100644 --- a/gdk/gdkdraw.c +++ b/gdk/gdkdraw.c @@ -61,6 +61,15 @@ static void gdk_drawable_real_draw_pixbuf (GdkDrawable *draw GdkRgbDither dither, gint x_dither, gint y_dither); +static void gdk_drawable_real_draw_drawable (GdkDrawable *drawable, + GdkGC *gc, + GdkDrawable *src, + gint xsrc, + gint ysrc, + gint xdest, + gint ydest, + gint width, + gint height); G_DEFINE_ABSTRACT_TYPE (GdkDrawable, gdk_drawable, G_TYPE_OBJECT) @@ -74,6 +83,7 @@ gdk_drawable_class_init (GdkDrawableClass *klass) klass->get_clip_region = gdk_drawable_real_get_visible_region; klass->get_visible_region = gdk_drawable_real_get_visible_region; klass->draw_pixbuf = gdk_drawable_real_draw_pixbuf; + klass->draw_drawable = gdk_drawable_real_draw_drawable; } static void @@ -1506,6 +1516,31 @@ composite_565 (guchar *src_buf, } } +/* Implementation of the old vfunc in terms of the new one + in case someone calls it directly (which they shouldn't!) */ +static void +gdk_drawable_real_draw_drawable (GdkDrawable *drawable, + GdkGC *gc, + GdkDrawable *src, + gint xsrc, + gint ysrc, + gint xdest, + gint ydest, + gint width, + gint height) +{ + GDK_DRAWABLE_GET_CLASS (drawable)->draw_drawable_with_src (drawable, + gc, + src, + xsrc, + ysrc, + xdest, + ydest, + width, + height, + src); +} + static void gdk_drawable_real_draw_pixbuf (GdkDrawable *drawable, GdkGC *gc, -- 2.30.2